//3033.修改矩阵
//https://leetcode.cn/problems/modify-the-matrix
class Solution {
public:
    vector<vector<int>> modifiedMatrix(vector<vector<int>>& matrix) {
        int m = matrix.size(),n = matrix[0].size();
        vector<vector<int>> ret(matrix);
        for(int i = 0;i<n;++i)
        {
            int maxn = INT_MIN;
            for(int k = 0;k<m;++k) if(ret[k][i] > maxn) maxn = ret[k][i];
            for(int k = 0;k<m;++k) if(ret[k][i] == -1) ret[k][i] = maxn;
        }
        return ret;
    }
};